home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib12.dsk
/
FILL FIGURES.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
2KB
|
65 lines
1 REM ***********************
2 REM * FILL FIGURES *
3 REM * BY DICK CORNELIUS *
4 REM * COPYRIGHT (C) 1983 *
5 REM * BY MICROSPARC, INC. *
6 REM * LINCOLN, MA. 01773 *
7 REM ***********************
160 REM INITIALIZATION
170 HOME
180 HGR : SCALE= 1: ROT= 0: HCOLOR= 3
190 MOVEREG = -2613
200 HY = 226
210 CLR = 62450
220 TABLE = 768: REM THIS VALUE RELOCATES EVERYTHING
230 C$ = "GREEN"
240 REM POKES
250 SHAPE = TABLE +4:FILL = TABLE +6
260 FOR SPOT = (TABLE) TO TABLE +19: READ CODE: POKE SPOT,CODE: NEXT
270 DATA 1,0,4,0,4,0,162,4,160,3,32,1,246,169,0,197,234,240,243,96
280 MSB = INT(TABLE/256):LSB = TABLE -256 *MSB
290 POKE 232,LSB: POKE 233,MSB
300 MSB = INT(SHAPE/256):LSB = SHAPE -256 *MSB
310 POKE FILL +1,LSB: POKE FILL +3,MSB
320 REM HPLOT BOX
330 HOME : CALL CLR
340 X(1) = RND(1) *100:X(4) = RND(1) *100
350 X(2) = RND(1) *100 +170:X(3) = RND(1) *100 +170
360 Y(1) = RND(1) *70:Y(2) = RND(1) *70
370 Y(3) = RND(1) *70 +90:Y(4) = RND(1) *70 +90
380 HPLOT X(1),Y(1) TO X(2),Y(2) TO X(3),Y(3) TO X(4),Y(4) TO X(1),Y(1)
390 HPLOT X(1) +1,Y(1) TO X(2) +1,Y(2) TO X(3) +1,Y(3) TO X(4) +1,Y(4) TO X(1) +1,Y(1)
400 X0 = (X(1) +X(2) +X(3) +X(4))/4:Y0 = (Y(1) +Y(2) +Y(3) +Y(4))/4
410 X0 = 2 *( INT(X0/2))
420 IF C$ = "GREEN" OR C$ = "ORANGE" THEN X0 = X0 +1
430 REM FILL
440 X = X0:INC = 2
450 Y = Y0
460 POKE TABLE +4,4: GOSUB 690
470 IF ABS(CY -Y) <2 THEN 530
480 TY = CY
490 POKE TABLE +4,6: GOSUB 690
500 IF ABS(CY -Y) <3 THEN 530
510 BY = CY:Y = (TY +BY)/2
520 X = X +INC: IF X <280 AND X >0 THEN 460
530 IF INC >0 THEN INC = -INC:X = X0 +INC: GOTO 450
540 IF ABS(CY -Y) <3 THEN 560
550 X = X -1: IF X >0 THEN 490
560 REM PREPARE FOR NEXT FIGURE
570 IF C$ = "GREEN" THEN C$ = "VIOLET": GOTO 610
580 IF C$ = "VIOLET" THEN C$ = "ORANGE": GOTO 610
590 IF C$ = "ORANGE" THEN C$ = "BLUE": GOTO 610
600 IF C$ = "BLUE" THEN C$ = "GREEN"
610 HCOLOR= 3: IF C$ = "BLUE" OR C$ = "ORANGE" THEN HCOLOR= 7
620 FOR PAUSE = 1 TO 100
630 IF PEEK( -16384) <127 THEN 670
640 GET G$
650 IF G$ = " " THEN I = 200
660 IF G$ = CHR$(27) THEN HOME : TEXT : HOME : END
670 NEXT
680 GOTO 320
690 REM SUBROUTINE
700 DRAW 1 AT X,Y
710 CALL FILL
720 CALL MOVEREG:CY = PEEK(HY)
730 RETURN